<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String root = request.getContextPath();
	response.setHeader("expires","0");
%>
<html>
	<head>
		<title>My JSP 'admin_state.jsp' starting page</title>

		<link rel="stylesheet" type="text/css"
			href="<%=root%>/style/tablesorter/css/style.css" />
		<style type="text/css">
<!--
body {
	margin:0px;
	padding:0px;
}

.write_article_menu_item {
	background: transparent url(<%=root%>/images/add.gif) scroll no-repeat
		left top;
	padding-top: 6px;
	padding-left: 8px;
}

.delete_article_menu_item {
	background: transparent url(<%=root%>/images/delete.gif) scroll
		no-repeat left top;
	padding-top: 6px;
	padding-left: 8px;
}

.search_article_menu_item {
	background: transparent url(<%=root%>/images/search.gif) scroll
		no-repeat left top;
	padding-top: 6px;
	padding-left: 8px;
}

.refresh_article_menu_item {
	background: transparent url(<%=root%>/images/refresh.gif) scroll
		no-repeat left top;
	padding-top: 6px;
	padding-left: 8px;
}

.search_article {
	background: transparent url(<%=root%>/images/search.gif) scroll
		no-repeat left top;
	padding-top: 6px;
	padding-left: 8px;
}

.modify_article {
	background: transparent url(<%=root%>/images/pen_modify.gif) scroll
		no-repeat left top;
	padding-left: 20px;
	height: 20px;
	width: 20px;
}

#articles_grid {
	margin-top: 0px;
}

.toolbar {
	background-image:url(<%=root%>/images/toolbar_bg.gif);
	background-repeat:repeat-x;
	height:30px;
	margin-bottom: 0px;
	width: 100%;
	border-bottom: 1px SOLID #333333;
}

.toolbar .menu {
	margin-top: 8px;
	margin-left: 0px;
	margin-bottom: 5px;
}

.toolbar .menu li {
	display: inline;
	margin-left: 10px;
	font-size: 12px;
	padding-left: 20px;
	text-decoration: none;
	border-right: 1px SOLID #888888;
}

.toolbar .menu li a:hover {
	font-weight: BOLD;
	color: #efefef;
}

.toolbar .menu li a {
	text-decoration: none;
	color: #efefef;
}

.toolbar .menu li a:visited {
	text-decoration: none;
	color: #efefef;
}

#articles_grid a:hover,a:visited,a {
	text-decoration: none;
	color: #8e8e8e;
}

#articles_grid a:hover {
	position: relative;
	top: 1px;
	left: 1px;
	color: #333333;
	display:none;
}

.type_add_container {
	width:330px;
	border: 1px SOLID #333333;
	background-color:#e8e8e8;
	z-index: 1000;
	font-size:12px;
	position:absolute;
	display:none;
}

.type_add_container .container_header {
	background-color:#000000;
	height:30px;
	border-top:2px SOLID #CCCCCC;
	border-left:2px SOLID #888888;
	border-bottom:2px SOLID #3c3c3c;
}
.container_header .close_btn {
	float:right;
	width:20px;
	height:20px;
	margin-top:8px;
	margin-right:5px;
	background:transparent url(<%=root%>/images/close_win.gif) scroll no-repeat left top;
}

.setting_item {
	clear: both;
	margin-bottom: 10px;
	margin-left:3px;
}

.setting_item label {
	width: 40px;
	display: block;
	float: left;
	padding-top: 5px;
}

.setting_item input {
	width:250px;
}

.setting_item textarea {
	width: 250px;
	border: 1px SOLOD #8e8e8e;
	height: 150px;
}
-->
</style>
		<script type="text/javascript"
			src="<%=root%>/scripts/jquery-1.3.2.min.js"></script>
		<script type="text/javascript"
			src="<%=root%>/scripts/jquery-latest.js"></script>
		<script type="text/javascript"
			src="<%=root%>/scripts/jquery.tablesorter.min.js"></script>
		<script type="text/javascript"
			src="<%=root%>/scripts/jquery.ckking.js"></script>
		<script src="<%=root%>/scripts/jquery.corner.js"
			type="text/javascript"></script>

		<script type="text/javascript">
		<!--
		$(function(){
			$("#articles_grid").tablesorter({headers:{0:{sorter:false}}} );
			$('#chking').accession();
			$('.type_add_container').corner('15px');
			$('#add_new').click(function(){
				var new_win=$('.type_add_container');
				new_win.css("left",($("body").width()-new_win.width())/2);
				new_win.css("top",($("body").height())/2);
				new_win.toggle('slow');
			});
			
			$('#type_opt').click(function(){
				var new_win=$('.type_add_container');
				new_win.toggle('slow');
				$.ajax({
					url:'<%=root%>/admin/catogoryAdd.action',
					dataType:'script',
					data:{
						'saveOrUpdateCatogory.name':$('#catogory_name').val(),
						'saveOrUpdateCatogory.catogoryDescritpion':$('#catogory_catogoryDescritpion').val()
					},
					success:function(data){
						eval(data);
					}
				});
			});
			
			$('.close_btn').click(function(e){
				var new_win=$('.type_add_container');
				new_win.toggle('slow');
			});
			$('#refresh').click(function(){
				window.location.reload();
			});
		});
		
		-->
		</script>
	</head>

	<body style="margin: 0; padding: 0">
			<div class="toolbar">
				<ul class="menu">
					<li class="write_article_menu_item" rel="add_frame_container">
						<a href=### id="add_new">增加分类</a>
					</li>
					<li class="delete_article_menu_item">
						<a href="javascript:$('#catogories_form').submit();">删除</a>
					</li>
					<li class="refresh_article_menu_item">
						<a href="###" id="refresh">刷新</a>
					</li>
				</ul>
			</div>
			<div class="type_display">
				<table id="articles_grid" class="tablesorter" border="0"
					cellpadding="0" cellspacing="0">
					<thead>
						<th width="20">
							<input type='checkbox' id="chking" />
						</th>
						<th width="60">
							名称
						</th>
						<th width="70">
							创建日期
						</th>
						<th width="70">
							修改日期
						</th>
						<th width="70">
							文章数
						</th>
						<th>
							动作
						</th>
					</thead>
					<form action="/admin/catogoryDelete.action" method="post"
					id="catogories_form">
						<tbody>
							<s:iterator value="catogories" id="catogory" status="status">
								<tr>
									<td>
										<input type='checkbox' class="slave" name='deleteCatogoriesId'
											value='<s:property value="#catogory.id" />' />
									</td>
									<td>
										<s:property value="#catogory.name" />
									</td>
									<td>
										<s:date name="#catogory.writeDate" format="yyyy-mm-dd HH:MM" />
									</td>
									<td>
										<s:date name="#catogory.editedDate" format="yyyy-mm-dd HH:MM" />
									</td>
									<td>
										<s:property value="#catogory.articleCount" />
									</td>
									<td>
										<a class="modify_article">
									</td>
								</tr>
							</s:iterator>
						</tbody>
					</form>
				</table>
			</div>
		<div class='type_add_container'>
			<div class="container_header">
				<div class="close_btn"></div>
			</div>
			<form method="post" action="<%=root%>/admin/typeAdd.action">
				<div class="setting_item">
					<label>
						名称*
					</label>
					<input type="text" id="catogory_name"/>
				</div>
				<div class="setting_item">
					<label>
						描述*:
					</label>
					<textarea id="catogory_catogoryDescritpion"></textarea>
				</div>
				<div>
					<input type="button" id="type_opt" value="增加" style="float:right;margin-right:30px" />
				</div>
			</form>
		</div>
	</body>
</html>
